package com.dartfar.workflow.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;


/**
 * 流程功能挂接表
 * @author 王琦
 *
 */
@Entity
@Table(name = "T_WorkflowProcessFunMount")
public class WorkflowProcessFunMount {
	//主键
	private int id;
	//业务实体路径
	private String modelName;
	//业务实体主键名称
	private String modelIdName;
	//是否可回退
	private String rollBackAble;
	//是否可取回
	private String withrawAble;
	//流程部署ID
	private String deployId;
	//流程定义ID
	private String processDefinitionId;
	//流程名称
	private String processName;
	//流程Key
	private String processKey;
	//挂接状态
	private String mountStatus;
	//流程定义部署ID
	private String workflowDeploymentId;
	//流程版本
	private Long version;
	//流程任务挂接信息
	private List<WorkflowTaskFunMount> workflowTaskFunMounts;
	//流程任务事件信息
	private List<WorkflowEvents> workflowEvents;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getModelName() {
		return modelName;
	}
	public void setModelName(String modelName) {
		this.modelName = modelName;
	}
	public String getModelIdName() {
		return modelIdName;
	}
	public void setModelIdName(String modelIdName) {
		this.modelIdName = modelIdName;
	}
	public String getDeployId() {
		return deployId;
	}
	public void setDeployId(String deployId) {
		this.deployId = deployId;
	}
	public String getProcessName() {
		return processName;
	}
	public void setProcessName(String processName) {
		this.processName = processName;
	}
	public String getProcessKey() {
		return processKey;
	}
	public void setProcessKey(String processKey) {
		this.processKey = processKey;
	}
	public String getMountStatus() {
		return mountStatus;
	}
	public void setMountStatus(String mountStatus) {
		this.mountStatus = mountStatus;
	}
	@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL}, mappedBy = "workflowProcessFunMount")
	@LazyCollection(LazyCollectionOption.TRUE)
	public List<WorkflowTaskFunMount> getWorkflowTaskFunMounts() {
		return workflowTaskFunMounts;
	}
	public void setWorkflowTaskFunMounts(
			List<WorkflowTaskFunMount> workflowTaskFunMounts) {
		this.workflowTaskFunMounts = workflowTaskFunMounts;
	}
	@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL}, mappedBy = "workflowProcessFunMount")
	@LazyCollection(LazyCollectionOption.TRUE)
	public List<WorkflowEvents> getWorkflowEvents() {
		return workflowEvents;
	}
	public void setWorkflowEvents(List<WorkflowEvents> workflowEvents) {
		this.workflowEvents = workflowEvents;
	}
	public String getRollBackAble() {
		return rollBackAble;
	}
	public void setRollBackAble(String rollBackAble) {
		this.rollBackAble = rollBackAble;
	}
	public String getWithrawAble() {
		return withrawAble;
	}
	public void setWithrawAble(String withrawAble) {
		this.withrawAble = withrawAble;
	}
	public String getWorkflowDeploymentId() {
		return workflowDeploymentId;
	}
	public void setWorkflowDeploymentId(String workflowDeploymentId) {
		this.workflowDeploymentId = workflowDeploymentId;
	}
	public Long getVersion() {
		return version;
	}
	public void setVersion(Long version) {
		this.version = version;
	}
	public String getProcessDefinitionId() {
		return processDefinitionId;
	}
	public void setProcessDefinitionId(String processDefinitionId) {
		this.processDefinitionId = processDefinitionId;
	}

}
